﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZhimeiSoft.Framework.Client.Control.DateTimeGrid
{
    public partial class DayDateTimeForHoursTitle : UserControl, IDateTimeView
    {
        private DateTime nowDateTime = new DateTime();
        private DayDateTimeForHour[] DayDateTimeForHours = null;

        public DayDateTimeForHoursTitle()
        {
            InitializeComponent();

            nowDateTime = DateTime.Now;
            DayDateTimeForHours = new DayDateTimeForHour[]{
                dayDateTimeForHour1,dayDateTimeForHour2,dayDateTimeForHour3,dayDateTimeForHour4,dayDateTimeForHour5,dayDateTimeForHour6,
                dayDateTimeForHour7,dayDateTimeForHour8,dayDateTimeForHour9,dayDateTimeForHour10,dayDateTimeForHour11,dayDateTimeForHour12,
                dayDateTimeForHour13,dayDateTimeForHour14,dayDateTimeForHour15,dayDateTimeForHour16,dayDateTimeForHour17,dayDateTimeForHour18,
                dayDateTimeForHour19,dayDateTimeForHour20,dayDateTimeForHour21,dayDateTimeForHour22,dayDateTimeForHour23,dayDateTimeForHour24
            };
            initDate(nowDateTime);
        }

        public void initDate(DateTime dtInit)
        {
            DateTime initDateTime = new DateTime(dtInit.Year, dtInit.Month, dtInit.Day,
                0, DateTime.Now.Minute, DateTime.Now.Second);
            for (int i = 0; i < 24; i++)
            {
                initDateTime = new DateTime(dtInit.Year, dtInit.Month, dtInit.Day,
                i, dtInit.Minute, dtInit.Second);
                DayDateTimeForHours[i].setDateTime(initDateTime);
            }

        }
        /// <summary>
        /// 显示小时
        /// </summary>
        /// <param name="bShow"></param>
        public void showTime(bool bShow)
        {
            foreach (DayDateTimeForHour timeForHour in DayDateTimeForHours)
            {
                timeForHour.timePanelVisible = bShow;
            }
        }

        public void showTimeTitle(string title)
        {
            panelTimeTitle.Text = title;
        }


        #region IDateTimeView 成员

        public DateTime getDateTime()
        {
            throw new NotImplementedException();
        }

        public void setDateTime(DateTime dateTime)
        {
            throw new NotImplementedException();
        }

        public void addItem(string valueList)
        {
            throw new NotImplementedException();
        }

        public int getItemID()
        {
            throw new NotImplementedException();
        }

        public void delItem(int indexID)
        {
            throw new NotImplementedException();
        }

        public void setEffectiveColor(bool bEffective)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
